<!-- 我的弹窗 -->

<template>
  <div>
    <DetailDefence v-model="defenceVisible" :id="defenceVisible ? map_one.detailId : ''" @change="toChange" />

    <DetailVideo v-model="lineVisible" :id="lineVisible ? map_one.detailId : ''" @change="toChange" />
  </div>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import MyModal from '@admin/views/Secure/Access/AccessList/MyModal'

// ============================== 导出组件 ============================== //

export default CORE.extend(MyModal, {
  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: {
    /**
     * 防区弹窗可见 (双向绑定)
     */
    defenceVisible: {
      get() {
        return this.map_one.deviceCategoryId === '4' && this.map_visible
      },
      set() {
        this.map_closeModal()
        setTimeout(() => this.map_setOne(), 300)
      },
    },

    /**
     * 周界弹窗可见 (双向绑定)
     */
    lineVisible: {
      get() {
        return this.map_one.deviceCategoryId === '1' && this.map_visible
      },
      set() {
        this.map_closeModal()
        setTimeout(() => this.map_setOne(), 300)
      },
    },
  },
})
</script>
